<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    //语法：new Promise((resolve,reject)=>{})
    new Promise((resolve,reject)=>{
         //用定时器模拟一个耗时任务,3s后任务执行完毕
        setTimeout(()=>{
            // resolve(1111111)
            reject(55555555555555)
        },3000)
    })
    .then((res)=>{
        console.log('Promise对象的状态变为 finished 成功',res);
    })
    .catch((err)=>{
        console.log('Promise对象的状态变为 rejected 失败',err);
    })
</script>
